{% extends 'insight/layout.html' %}
{% block title %}换电站列表{% endblock %}
{% block content %}
<div class="container">
    <div class="row">
        <div class="col" align="center">
            <h2>{{station.station_name}}</h2>
            <p align="right"><a href="/insight/swap_service/{{station.station_id}}">换电服务记录</a></p>
            <table class="table table-striped">
                <tr>
                    <td>换电站厂家：{{station.station_maker}}</td>
                    <td>归属：{{station.business_unit}}</td>
                </tr>
                <tr>
                    <td>换电站型号：{{station.station_type}}</td>
                    <td>站控型号：{{station.get_software_version_display}}</td>
                </tr>
                <tr>
                    <td>驱动方式：{{station.get_drive_type_display}}</td>
                    <td>换电机器人型号：{{station.robot_type}}</td>
                </tr>
                <tr>
                    <td>电池仓排布：{{station.get_robot_direction_display}}</td>
                    <td>驱动电机数量：{{station.motor_count}}</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="row">
        <div class="col" align="center">
            {% if predictions %}
            <h2>故障预测</h2>
            <table class="table table-striped">
                <tr>
                    <td>特征物理量</td>
                    <td>特征统计方法</td>
                    <td>特征日期</td>
                    <td>特征值</td>
                    <th>sigma</th>
                    <th>上限值</th>
                    <th>下限值</th>
                </tr>
                {% for prediction in predictions %}
                <tr>
                    <td>{{ prediction.quantityDesc }}</td>
                    <td>{{ prediction.methodDesc }}</td>
                    <td>{{ prediction.feature_date|date:'Y-m-d' }}</td>
                    <td><a href="/insight/fault_prediction_view/{{prediction.prediction_id}}">{{prediction.feature_value}}</a></td>
                    <td>{{ prediction.sigma }}</td>
                    <td>{{prediction.upper_limit}}</td>
                    <td>{{prediction.down_limit}}</td>
                </tr>
                {% endfor %}
            </table>
            {% else %}
            <p>未查询到故障预测记录</p>
            {% endif %}
        </div>
    </div>
    <div class="row">
        <div class="col" align="center">
            <h2>换电机器人特征矩阵</h2>
            <table class="table table-striped">
                <tr>
                    <td>特征名称</td>
                    {% for statistical_method in statistical_methods%}
                        <td align="center">{{statistical_method.method_name}}</td>
                    {%endfor%}
                </tr>
                {%for physical_quantity in physical_quantities%}
                    <tr>
                        <td>{{physical_quantity.quantity_name}}</td>
                        {%for statistical_method in statistical_methods%}
                        <td><a target="_blank" href="/insight/daily_feature_line/{{station.station_id}}/{{physical_quantity.quantity_name}}/{{statistical_method.method_name}}">
                            {{physical_quantity.quantity_desc}}{{statistical_method.method_desc}}
                               </a>
                        </td>
                        {%endfor%}
                    </tr>
                {%endfor%}
            </table>
        </div>
    </div>
</div>
{% endblock %}